package at.fhooe.mc.master.clc.client.presenter;

import at.fhooe.mc.master.clc.client.MetricsVisualizationEventBus;
import at.fhooe.mc.master.clc.client.view.MetricsVisualizationView;

import com.google.gwt.user.client.ui.IsWidget;
import com.mvp4g.client.annotation.Presenter;
import com.mvp4g.client.presenter.BasePresenter;

@Presenter(view = MetricsVisualizationView.class)
public class MetricsVisualizationPresenter extends BasePresenter<MetricsVisualizationPresenter.IMetricsVisualizationView, MetricsVisualizationEventBus>
{
	public interface IMetricsVisualizationView extends IsWidget
	{
		public void addGrapWidget(IsWidget graph, int key);
		
		public void removeGraphWidget(IsWidget graph, int key);

		public void setDataRequestWidget(IsWidget dataRequestWidget);
	}
	
	public void onStart()
	{
		eventBus.addRootTab(view, "Datastore Metrics Visualization");
	}
	
	public void onSetMetricsRequestWidget(IsWidget widget)
	{
		view.setDataRequestWidget(widget);
	}
	
	public void onAddGraph(IsWidget widget, int key)
	{
		view.addGrapWidget(widget, key);
	}
	
	public void onRemoveGraph(IsWidget widget, int key)
	{
		view.removeGraphWidget(widget, key);
	}
	
}
